{% extends "../theme/bage_add_edit.html" %}
{% block typebody %}

<ol class="breadcrumb">
    <li><a href="/">{{ _('Home') }}</a></li>
    <li><a href="/tutorial/">{{ _('Tutorials') }}</a></li>
    <li class="active">{{ _('Add tutorial')}}</li>
</ol>
<div class="panel panel-black">
    <div class="panel-heading">
        {{ _('Add tutorial')}}
    </div>
    <div class="panel-body">
        <form method="post" class="form-horizontal" role="form" id="form_post">
            <input type=hidden name=uid value="{{ kwd['uid'] }}">
            <input type=hidden id="keywords" name="keywords">
            <fieldset>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="title">{{ _('Title') }}</label>

                    <div class="col-sm-10">
                        <input class="form-control" type="text" id="title" name="title">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="tags">{{ _('label') }}</label>

                    <div class="col-sm-10">
                        <input class="form-control" id="tags" name="tags" type="text"/>
                    </div>
                </div>
                {% for ii in range(0,5) %}
                <div class="form-group">
                    {% if ii == 0 %}
                    <label for="pcat0" class="col-sm-2 control-label">{{ _('Category') }}</label>
                    {% else %}
                    <label for="pcatx" class="col-sm-2 control-label"></label>
                    {% end %}
                    <div class="col-sm-3">
                        <select name="pcat{{ii}}" id="pcat{{ii}}" class="form-control"
                                onchange="g_load_postcat({{ii}})">
                            <option value="">{{ _('Please select') }}</option>
                            {% for taginfo in tag_infos %}
                            {% if taginfo.uid.endswith('00') %}
                            <option value="{{ taginfo.uid }}">{{ taginfo.name }}
                            </option>
                            {% else %}
                            {% end %}
                            {% end %}
                        </select>
                    </div>
                    <div class="col-sm-4">
                        <select name="gcat{{ii}}" id="gcat{{ii}}" class="form-control">

                        </select>
                    </div>
                </div>
                {% end %}


                <div class="form-group">
                    <label class="col-sm-2 control-label" for="logo">{{ _('Picture') }}</label>

                    <div class="col-sm-10">

                        <input type="text" id="logo" name="logo" class="form-control" readonly/>

                        <br>

                        <a class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">
                            {{ _('Upload picture') }}
                        </a>


                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label" for="cnt_md">{{ _('Content') }} </label>

                    <div class="col-sm-10">
                        <textarea rows=26 id="cnt_md" name="cnt_md" cols="80" class="form-control"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="memo">{{ _('Memo') }} </label>

                    <div class="col-sm-10">
                        <textarea class="form-control" rows=10 id="memo" name="memo"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="sub1"></label>

                    <div class="col-sm-10">
                        <input id="sub1" type="submit" class="btn btn-primary" value="{{ _('Submit') }}"/>
                    </div>
                </div>
            </fieldset>
        </form>
        {% module upload_pic() %}
    </div>
</div>
{% end %}
